package com.xwqiang.handle;


import com.xwqiang.utils.AppExceptionCodeMsg;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class AppException extends  RuntimeException {

    private int code = 500;

    private String msg = "服务器异常";

    public AppException(AppExceptionCodeMsg appExceptionCodeMsg) {
        super();
        this.code = appExceptionCodeMsg.getCode();
        this.msg = appExceptionCodeMsg.getMsg();
    }


    public AppException(int code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }


}
